/*
 * app_config.h
 *
 *  Created on: 04.08.2013
 *      Author: SpirTanol
 */

#ifndef APP_CONFIG_H_
#define APP_CONFIG_H_

#include "global.h"

// Qt
#include <QString>

class AppConfig
{
public:
	static AppConfig *i();

	inline void setLastPath(const QString &lastPath) { oLastPath = lastPath; }
	inline const QString &lastPath() const { return oLastPath; }

	inline void setScaleType(ScaleType scaleType) { oScaleType = scaleType; }
	inline ScaleType scaleType() const { return oScaleType; }

	inline void setAutoConnect(bool autoConnect) { oAutoConnect = autoConnect; }
	inline bool autoConnect() const { return oAutoConnect; }

	inline void setInterval(uint interval) { oInterval = interval; }
	inline uint interval() const { return oInterval; }

	inline void setSpeedIndex(int idx) { oSpeedIndex = idx; }
	inline int speedIndex() const { return oSpeedIndex; }

	inline void setPort(int port) { oPort = port; }
	inline int port() const { return oPort; }

	bool load();
	bool save() const;

private:
	static AppConfig *sAppConfig;

	QString oLastPath;
	bool oAutoConnect;
	ScaleType oScaleType;
	uint oInterval;

	int oSpeedIndex;
	int oPort;

	AppConfig();
	~AppConfig();

};

#endif /* APP_CONFIG_H_ */
